<template>
  <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
    <el-tab-pane :label="$t('IPv4路由')" name="first">
      <Ipv4></Ipv4>
    </el-tab-pane>
    <el-tab-pane :label="$t('IPv6路由')" name="second">
      <Ipv6 v-if="loading === 'second'"></Ipv6>
    </el-tab-pane>
  </el-tabs>
</template>
<script>
import Ipv4 from './components/Ipv4'
import Ipv6 from './components/Ipv6'
export default {
  name: 'Server',
  components: {
    Ipv4,
    Ipv6
  },
  data () {
    return {
      activeName: 'first',
      loading: ''
    }
  },
  methods: {
    handleClick (tab, event) {
      this.loading = tab.name
    }
  }
}
</script>
